import React from 'react';

const Widget = React.createClass({
  close() {
    this.props.closeLogo();
  },
  render() {
    const { closeLogo, widgetHeader, widgetHeaderTwo, widgetName, widgetTwoName, widgetNameWidgth } = this.props;
    return (
      <div className="widget">
        <div className="widget-header">
          {
            widgetName ?
              <span className="widget-name" >
                <p title={widgetName} className={widgetNameWidgth}>{widgetName}</p>
                <p className="font-16" title={widgetTwoName}>{widgetTwoName}</p>
              </span>
            :
              ''
          }
          <span className="widget-caption">{widgetHeader}</span>
          {
            widgetHeaderTwo ?
              <img className="ml15 mr15" src="/static/dist-static/img/two_small.png" alt="" />
            :
              ''
          }
          <span className="widget-caption">{widgetHeaderTwo}</span>
          {
            closeLogo ?
              <img
                className="dialog-close"
                src="/static/dist-static/img/close.png" alt=""
                onClick={this.close}
              />
            :
              ''
          }
        </div>
      </div>
    );
  }
});

export default Widget;
